﻿#include <iostream>
using namespace std;
inline void simplefunc1() {
	cout << "1";
}
void inlinefunc2() {
	cout << "2";
}
int main()
{
	cout << "请输入函数执行次数N:";
	int n;
	cin >> n;
	cout << "";
	clock_t startNormal = clock();
	for (int i = 0; i < n; i++) {
		simplefunc1();
	}
	clock_t endNormal = clock();
	double durationNormal = double(endNormal - startNormal) / CLOCKS_PER_SEC * 1000;
	clock_t startInline = clock();
	for (int i = 0; i < n; i++) {
		inlinefunc2();
	}
	clock_t endInline = clock();
	double durationInline = double(endInline - startInline) / CLOCKS_PER_SEC * 1000;
	cout << endl;
	cout << "普通函数执行N次时间为：" << durationNormal << endl;
	cout << "内联函数执行N次时间为：" << durationInline<<endl;
}
